/**
 * Copyright (C), 2015-2018, XXX有限公司
 * FileName: JobLogController
 * Author:   zhouheng
 * Date:     2018/7/26 21:55
 * Description: 调度日志控制类
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.hengby.hengcrud.modular.job.controller;

import com.hengby.hengcrud.modular.base.controller.BaseController;
import com.hengby.hengcrud.modular.job.model.JobLog;
import com.hengby.hengcrud.modular.job.service.JobLogService;
import com.hengby.hengcrud.modular.job.wrapper.JobLogWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
import java.util.Map;

/**
 * 〈一句话功能简述〉<br> 
 * 〈调度日志控制类〉
 *
 * @author zhouheng
 * @create 2018/7/26
 * @since 1.0.0
 */

@Controller
@RequestMapping("/jobLog")
public class JobLogController extends BaseController{
    private static final String PREFIX_ = "/system/job/";
    @Autowired
    private JobLogService jobLogService;

    @RequestMapping("")
    public String jobLog(){
        return PREFIX_ + "jobLog";
    }

    @RequestMapping("/list")
    public Object list(){
        List<Map<String,Object>> list = this.jobLogService.findAllJobLogs();
        // 包装list
        JobLogWrapper wrapper = new JobLogWrapper(list);
        Object object = wrapper.wrap();

        return object;
    }

}